<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePositionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('positions', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('用户id');
            $table->integer('company_id')->comment('公司id');
            $table->string('type', 255)->comment('职位类型');
            $table->string('name', 20)->comment('职位名称');
            $table->string('address', 20)->comment('工作地点');
            $table->string('nature', 64)->comment('工作性质');
            $table->string('min_salary', 64)->comment('最低薪资');
            $table->string('max_salary', 64)->comment('最高薪资');
            $table->string('edu', 64)->comment('最低学历');
            $table->string('dept_name',255)->comment('部门名称');
            $table->string('person',20)->comment('负责人');
            $table->string('experience', 64)->comment('工作经验');
            $table->string('demand', 500)->comment('岗位要求');
            $table->string('duty', 500)->comment('任职要求');
            $table->tinyInteger('is_use')->default(1)->comment('是否开启 1：是 2：否');
            $table->tinyInteger('status')->default(0)->comment('是否删除 1：是 0：否');
            $table->integer('created_at')->comment('创建时间');
            $table->integer('updated_at')->comment('最后更新时间');
        });
        DB::statement("ALTER TABLE `positions` comment '职位表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('positions');
    }
}
